package com.flower.config;/*
 *@ClassName AppConfig
 *@Description TODO
 *@Author 吃麻椒的花酱
 *@Date 2021/5/20 23:21
 *@Version 1.0
 */

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class AppConfig {
    @Bean
    @LoadBalanced//RestTemplate调用可以实现负载均衡
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }


}
